package mytest.wd;

import com.alibaba.fastjson.JSONObject;

import java.util.Map;

public class Test7 {

    public static void main(String[] args) {

        String str = "{\n" +
                "      \"userInfo\": \"8109008804\",\n" +
                "      \"userInfoType\": \"phone\",\n" +
                "      \"vendor\": \"nigeria\",\n" +
                "      \"bizType\": \"alend\",\n" +
                "      \"flag\": \"pre_credit\",\n" +
                "      \"state\": \"0\",\n" +
                "      \"batch\": \"\",\n" +
                "      \"time\": \"1721031068318\",\n" +
                "      \"extra\": \"{\\\"amount\\\":\\\"0\\\"}\"\n" +
                "    }";

        Map<String, Object> map =JSONObject.parseObject(str, Map.class);
        String extra = (String) map.get("extra");
        Map<String, Object> extraMap = JSONObject.parseObject(extra);
        System.out.println(extraMap.get("amount"));

//        System.out.println(System.currentTimeMillis());

    }

}
